package com.ttt.gdfood.service;

import com.ttt.gdfood.entity.Comment;
import com.ttt.gdfood.entity.Video;
import com.ttt.gdfood.mapper.VideoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class VideoService {
    @Autowired
    VideoMapper videoMapper;
    public List<Video> getAllVideo(){
        return videoMapper.allVideo();
    }

    public void addVideo(Video video){
        Date now = new Date();
        video.setCreate_time(now);
        video.setSrc("http://8.142.20.59:9000/gdfood/"+video.getSrc());

        videoMapper.addVideo(video);
    }
}
